package com.xls.pet.controller;

import com.xls.pet.common.Result;
import com.xls.pet.service.MinioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/common")
public class MiniController {

    @Autowired
    MinioService minioService;

    @PostMapping("/upload")
    public Result<?> uploadFile(@RequestPart MultipartFile file) {
        return Result.success(minioService.uploadFile(file));
    }

    // todo delete non-use image
}
